import 'package:flutter/material.dart';
import 'package:flutter_eve_plugin/constants/font_family.dart';
import 'package:flutter_eve_plugin/constants/font_weight.dart';
import 'package:flutter_eve_plugin/model/ye_xiu/achieves/archieves_ability_detail_entity.dart';
import 'package:flutter_eve_plugin/utils/screen_util.dart';

class ArchivesAbilityDetailsItemProgressWidget extends StatelessWidget {
  final ArchievesAbilityDetailPropertylist info;
  const ArchivesAbilityDetailsItemProgressWidget({
    Key key,
    @required this.index,this.info
  }) : super(key: key);

  final int index;

  @override
  Widget build(BuildContext context) {
    return Container(
      width: setRatio(190),
      height: setRatio(28),
      decoration: BoxDecoration(
          color: Color(0x4F000000),
          borderRadius: BorderRadius.circular(setRatio(3))),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          Text(
            '技能点：',
            style: TextStyle(
                color: Color(0xFFEFF0F8),
                fontFamily: FontFamily.PINGFANG,
                fontWeight: FontWeightCustom.PF_Medium,
                fontSize: setTextSp(14)),
          ),
          SizedBox(
            width: setRatio(110),
            height: setRatio(28),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: <Widget>[
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  crossAxisAlignment: CrossAxisAlignment.end,
                  children: <Widget>[
                    Text(
                      '${info.value}',
                      style: TextStyle(
                          color: Color(0xFF6AF8D1),
                          fontFamily: FontFamily.PINGFANG,
                          fontWeight: FontWeightCustom.PF_Medium,
                          fontSize: setTextSp(11)),
                    ),
                    Text(
                      '下一级',
                      style: TextStyle(
                          color: Color(0xFFEFF0F8),
                          fontFamily: FontFamily.PINGFANG,
                          fontWeight: FontWeightCustom.PF_Medium,
                          fontSize: setTextSp(12)),
                    ),
                    Text(
                      '${info.max}',
                      style: TextStyle(
                          color: Color(0xFF20ECFF),
                          fontFamily: FontFamily.PINGFANG,
                          fontWeight: FontWeightCustom.PF_Medium,
                          fontSize: setTextSp(11)),
                    )
                  ],
                ),
                Container(
                  width: setRatio(110),
                  height: setRatio(3),
                  decoration: BoxDecoration(
                      color: Color(0x6F6BF9D0),
                      borderRadius: BorderRadius.circular(setRatio(2))),
                  child: Stack(

                    children: <Widget>[
                      Container(
                        width: setRatio(110) * ((info.percent) / 100),
                        height: setRatio(3),
                        decoration: BoxDecoration(
                            gradient: LinearGradient(
                                colors: [
                                  Color(0xFF6BF9D0),
                                  Color(0xFF61D4FF),
                                ],
                                begin: Alignment.centerLeft,
                                end: Alignment.centerRight),
                            borderRadius: BorderRadius.circular(setRatio(2))),
                      )
                    ],
                  ),
                ),
                SizedBox(height: setRatio(5)),
              ],
            ),
          )
        ],
      ),
    );
  }
}
